{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <input type="hidden" name="id" value="{$id}">
                        <input type="hidden" name="type" value="{$info.usetype}">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">学校名称：</label>
                            <div class="layui-input-block">
                                <input type="text" disabled name="active_name" placeholder="学校名称" class="layui-input" value="{$info.school}">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">年份：</label>
                            <div class="layui-input-block">
                                <input type="text" name="year" disabled value="{$info.year}" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">年级：</label>
                            <div class="layui-input-block">
                                <input type="text" name="grade" lay-verify="required" value="{$info.grade}" value="" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">开始日期：</label>
                            <div class="layui-input-block">
                                <input type="text" name="startdate" onclick="wk.lay_date_ymd(this);" value="{$info.startdate}" class="layui-input layer-date">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">截止日期：</label>
                            <div class="layui-input-block">
                                <input type="text" name="enddate" onclick="wk.lay_date_ymd(this);" value="{$info.enddate}" class="layui-input layer-date">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">二维码类型：</label>
                            <div class="layui-input-block">
                                <select disabled>
                                    <option value="1" {if $info.usetype == 1}selected{/if}>仅收集</option>
                                    <option value="2" {if $info.usetype == 2}selected{/if}>仅支付</option>
                                    <option value="3" {if $info.usetype == 3}selected{/if}>支付和收集</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 {if $info.usetype == 1}hidden{/if}">
                            <label class="layui-form-label">支付金额：</label>
                            <div class="layui-input-block">
                                <input type="number" min="0" step="0.01" name="active_member_num"  value="{$info.money}" placeholder="不填写则默认用户自定义金额，输入金额则固定支付金额，只保留两位小数" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('activeEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('Tg/schcode')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>
